# !/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
===========================
@Time : 2022/10/10 0010 23:50
@Author : 测试开发工程师
@File : goods_list_page.py
@Software: PyCharm
============================
"""

from selenium.webdriver.common.by import By
from last_testweb.Litemall_Project.page_objects.base_page import BasePage
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions


class GoodsListPage(BasePage):
    _TEXT_PRODUCT_NAME = (By.XPATH, "//tbody/tr[1]/td[3]/div")

    def get_product_name(self):
        element = WebDriverWait(self.driver, 10).until(
            expected_conditions.visibility_of_element_located(self._TEXT_PRODUCT_NAME))
        name = element.text
        return name
